package middleware

import (
	"github.com/gocraft/web"
	//"fmt"
	//"strings"
)

type Context struct {
	Session map[string]string
}

func (c *Context) LoadSession(writer web.ResponseWriter, request *web.Request, next web.NextMiddlewareFunc) {
	//fmt.Println("load session")
	//for h := range request.Header {
	//	fmt.Println(string(h), request.Header[h])
	//}
	//if ! strings.EqualFold(string(request.Header["Content-Type"][0]), "application/json"){
	//	fmt.Fprintln(writer, "header needs {\"Content-Type\": \"application/json\"}")
	//	return
	//}
	writerHeader := writer.Header()
	writerHeader.Set("Content-Type", "application/json")
	next(writer, request)
}
